package com.detoandy.controller;

import com.detoandy.dao.BlogRepository;
import com.detoandy.model.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by zhengdt on 2017/8/17.
 */
@RestController
@RequestMapping("/blog")
public class BlogController {

    @Autowired
    private BlogRepository blogRepository;

    @GetMapping("/getAllBlog")
    public List<Blog> getAllBlog() {
        return blogRepository.findAll();
    }


}
